<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
	$(function() {
		$('#zzgl_zzxx_datagrid').datagrid({
			url : '${pageContext.request.contextPath}/school/classInfoAction!datagrid.action',
			fit : true,
			fitColumns : true,
			border : false,
			rownumbers : true,
			pagination : true,
			sortName : 'classId',
			idField : 'id',
			singleSelect:true,
			//checkOnSelect:false,
			columns : [ [ {
				//field : 'id',
				title : '编号',
				width : 100,
				align : 'center',
				checkbox : true
			}, {
				field : 'classId',
				title : '班号',
				width : 150,
				align : 'center',
				sortable : true
			}, {
				field : 'className',
				title : '班级 ',
				width : 150,
				align : 'center',
				sortable : true
			}, {
				field : 'gradeName',
				title : '年级 ',
				width : 150,
				align : 'center',
				sortable : true
			}, {
				field : 'majorName',
				title : '专业',
				width : 150,
				align : 'center',
				sortable : true
			}, {
				field : 'collegeName',
				title : '学院',
				width : 150,
				align : 'center',
				sortable : true
			} ] ],
			toolbar : '#zzgl_zzxx_toolbar',
		});
		$('#zzgl_zzxx_classCmb').combobox({
			url : '${pageContext.request.contextPath}/school/classAction!getClassCmb.action',
			valueField : 'classId',
			textField : 'className'
		});
		$('#zzgl_zzxx_collegeCmb').combobox({
			url : '${pageContext.request.contextPath}/school/collegeAction!getCollegeCmb.action',
			valueField : 'collegeId',
			textField : 'collegeName'
		});
		$('#zzgl_zzxx_majorCmb').combobox({
			url : '${pageContext.request.contextPath}/school/majorAction!getMajorCmb.action',
			valueField : 'majorId',
			textField : 'majorName'
		});
		$('#zzgl_zzxx_gradeCmb').combobox({
			url : '${pageContext.request.contextPath}/school/gradeAction!getGradeCmb.action',
			valueField : 'gradeId',
			textField : 'gradeName'
		});
	});
	function searchFun() {
		$('#zzgl_zzxx_datagrid').datagrid('load', {
			className : $('#zzgl_zzxx_classCmb').combobox('getText'),
			collegeName : $('#zzgl_zzxx_collegeCmb').combobox('getText'),
			majorName : $('#zzgl_zzxx_majorCmb').combobox('getText'),
			gradeName : $('#zzgl_zzxx_gradeCmb').combobox('getText')
		});
	}
	function clearFun() {
		$('#zzgl_zzxx_form input[name=zzgl_zzxx_collegeName]').val('');
		$('#zzgl_zzxx_form input[name=zzgl_zzxx_collegeId]').val('');
		var classes = $('#zzgl_zzxx_classCmb').combobox('setText', '');
		var college = $('#zzgl_zzxx_collegeCmb').combobox('setText', '');
		var major = $('#zzgl_zzxx_majorCmb').combobox('setText', '');
		var grade = $('#zzgl_zzxx_gradeCmb').combobox('setText', '');
		$('#zzgl_zzxx_datagrid').datagrid('load', {});
	}
</script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',iconCls:'icon-table_multiple',title:'显示组织信息',border:false" style="height:200px;">
		<table id="zzgl_zzxx_datagrid"></table>
	</div>
</div>
<div id="zzgl_zzxx_toolbar" class="easyui-toolbar" style="background:#f9f9f9;">
	<table>
		<tr>
			<td style="padding:3px 5px 3px 15px;">学院 ：<input id="zzgl_zzxx_collegeCmb" name="collegeName" style="width:100px;" /></td>
			<td style="padding:3px 5px 3px 15px;">专业：<input id="zzgl_zzxx_majorCmb" name="majorName" style="width:100px;" /></td>
			<td style="padding:3px 5px 3px 15px;">年级：<input id="zzgl_zzxx_gradeCmb" name="gradeName" style="width:100px;" /></td>
			<td style="padding:3px 5px 3px 15px;">班级：<input id="zzgl_zzxx_classCmb" name="className" style="width:100px;" /></td>
			<td style="padding:3px 5px 3px 25px;"><a href="#" class="easyui-linkbutton" data-options="border:false,iconCls:'icon-search',plain:true" onclick="searchFun()">查询</a></td>
			<td style="padding:3px 5px 3px 5px;"><a href="#" class="easyui-linkbutton" data-options="border:false,iconCls:'icon-ext-bullet_cross',plain:true" onclick="clearFun()">清空</a></td>
		</tr>
	</table>
</div>
</body>
</html>

